package com.ecommerce.dal.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ecommerce.dal.dao.impl.PhotoDAO;
import com.ecommerce.dal.entity.Photo;
import com.ecommerce.dal.service.IPhotoManagerService;


@Service("photoManagerService")
public class PhotoManagerService implements IPhotoManagerService {

	@Autowired
	PhotoDAO photoDAO;
	@Override
	public Photo retrievePhoto(long photoId) {
		return photoDAO.findByPhotoId(photoId);
	}

	@Override
	public void savePhoto(Photo photo) {
		photoDAO.save(photo);
		
	}

//	@Override
//	public void save(Photo photo) {
//		// TODO Auto-generated method stub
//		
//	}

	@Override
	public void updatePhoto(Photo photo) {
		photoDAO.update(photo);
		
	}

	@Override
	public void deletePhoto(Photo photo) {
		photoDAO.delete(photo);
		
	}

//	@Override
//	public Photo findByPhotoId(long photoId) {
//		// TODO Auto-generated method stub
//		return null;
//	}

}
